<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--360浏览器优先以webkit内核解析-->
    <title>成都市12345话务接电系统</title>
    <link rel="shortcut icon" th:href="@{favicon.ico}">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="home" style="padding: 10px;">
    <!--    快捷系统功能    -->
    <div class="col-sm-12 home-fast" th:if="${shortcutFuns.size()>0}" style="border-radius: 10px">
        <div class="home-fast-top" >
            <div>快捷系统功能</div>
            <div><i class="fa fa-refresh"></i>刷新首页</div>
        </div>
        <div class="home-fast-centre">

            <div class="home-fast-centre-box" th:each="shortcutFun : ${shortcutFuns}" th:id="${shortcutFun.url}" th:title="${shortcutFun.name}" onclick="openUrl(this.title,this.id)">
                <img  th:src="${shortcutFun.imgUrl}">
                <div><a href="javascript:void(0)">[[${shortcutFun.name}]]</a></div>
            </div>

        </div>
    </div>
    <!--用户信息，重要代办提示-->
    <div class="col-sm-12" style="padding: 0;display: flex;padding: 0;justify-content: space-between;">
        <!--用户信息-->
        <div class="col-sm-4 home-fast" style="border-radius: 10px;margin: 10px 10px 0 0;">
            <div class="home-centre-name">
                <div>用户信息</div>
                <div><h4 style="color: #1a1a1a;padding-left: 20px">网络理政办</h4></div>
            </div>
            <div class="home-centre-message">
                <div class="home-centre-message-box">
                    <div>用户名</div>
                    <div style="color: #1a1a1a"><strong id="userId">[[${user.loginName}]]</strong></div>
                </div>
                <div class="home-centre-message-box">
                    <div>身份ID</div>
                    <div style="color: #1a1a1a"><strong  id="hdRole">[[${roles}]]</strong></div>
                </div>
                <div class="home-centre-message-box">
                    <div>姓名</div>
                    <div style="color: #1a1a1a"><strong id="userName">[[${user.userName}]]</strong></div>
                </div>
                <th:block th:if="${user.sortCode == '呼叫中心'}">
                <div class="home-centre-message-box">
                    <div>工号</div>
                    <div style="color: #1a1a1a"><strong id="hdWorkNo">[[${user.tklWNo}]]</strong></div>
                </div>
                <div class="home-centre-message-box">
                    <div>分机</div>
                    <div style="color: #1a1a1a"><strong id="hdSubTel">[[${user.tklTNo}]]</strong></div>
                </div>
                </th:block>
                <th:block th:unless="${user.sortCode == '呼叫中心'}">
                    <div class="home-centre-message-box">
                        <div>部门</div>
                        <div style="color: #1a1a1a"><strong>[[${user.dept?.deptName}]]</strong></div>
                    </div>
                </th:block>
            </div>
        </div>
        <!--重要待办事项提示-->
        <div class="col-sm-4 home-fast" style="border-radius: 10px;margin-top: 10px;">
            <div class="home-centre-name">
                <div>重要待办事项提示k</div>
            </div>
            <div class="col-sm-12 home-hint" style="overflow-y:scroll;z-index: 20;">
<!--                <div>-->
<!--                    - 暂无新的待办 - -->
<!--                </div>-->
                <div th:each="item:${wait}" style="margin-bottom: 5px">
                    <span style="cursor:pointer;" th:onclick="OpenMenuInParent([[${item['menuNo']}]])" th:utext="${item['clewDesc']}"></span>
                </div>
            </div>
            <div class="home-hint-img" style="z-index: 10;">
                <img th:src="@{/img/Inbox.png}" class="img img-object" style="width: 180px;height: 180px">
            </div>
        </div>
        <!--上级催办键-->
        <div class="col-sm-4 home-fast" style="border-radius: 10px;margin-top: 10px;margin-left: 10px;">
            <div class="home-centre-name">
                <div>上级催办键</div>
            </div>
            <div class="col-sm-12 home-hint" style="z-index: 20;overflow-y:scroll">
<!--                <div>-->
<!--                    - 暂无新的待办 - -->
<!--                </div>-->
                <div style="margin-bottom: 5px">
                    <span style="cursor:pointer;" th:onclick="openUrgeDetail('tel')">电话催办工单：<span class="spLRed">[[${urge.tel}]]</span> 件</span>
                </div>
                <div>
                    <span style="cursor:pointer;" th:onclick="openUrgeDetail('mail')">信件催办工单：<span class="spLRed">[[${urge.mail}]]</span> 件</span>
                </div>
            </div>
            <div class="home-hint-img">
                <img th:src="@{/img/Inbox.png}" class="img img-object" style="width: 180px;height: 180px">
            </div>
        </div>
    </div>

    <!--    日历，系统公告-->
    <div class="col-sm-12" style="padding: 0;display: flex;padding: 0;justify-content: space-between;">
        <!-- 日历-->
        <div  class="col-sm-3 home-fast" style="border-radius: 10px;margin: 10px 10px 10px 0;display: flex;justify-content: center;">
            <div id="test1"></div>
        </div>
        <!--系统通知公告-->
        <div class="col-sm-12 home-fast" style=" border-radius: 10px;margin: 10px 0 10px 0;">
            <div class="col-sm-12" style="color: #1a1a1a">
                <div class="home-centre-name col-sm-12">
                    <strong id="notifications">系统通知公告</strong>
                </div>
            </div>
            <div class="col-sm-12" style="">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#unRead" aria-expanded="true">未读</a></li>
                        <li class=""><a data-toggle="tab" href="#markRead" aria-expanded="false">已读</a></li>
                    </ul>
                    <div class="tab-content">
                        <!--未读：紧急/重要/普通-->
                        <div id="unRead" class="tab-pane active">
                            <div class="panel-body">
                                <div class="col-sm-12">
                                    <div class="tabs-container" id="isHidden">
                                        <ul class="nav nav-tabs">
                                            <li class="active"><a data-toggle="tab" href="#a" aria-expanded="true">紧急</a></li>
                                            <li class=""><a data-toggle="tab" href="#b" aria-expanded="false">重要</a></li>
                                            <li class=""><a data-toggle="tab" href="#c" aria-expanded="false">普通</a></li>
                                        </ul>
                                        <div class="tab-content">
                                            <div id="a" class="tab-pane active">
                                                <div class="panel-body">
                                                    <div class="ibox">
                                                        <div class="ibox-content">
                                                            <div  class="col-sm-12" style="border-radius: 10px;margin: 10px 0 10px 10px;height: 310px;overflow-y:scroll;background-color: #FFFFFF;padding: 0 0 20px;">
                                                                <div th:fragment="search" id="instancy" style="height: 100%" th:if="${instancy!=null}">
                                                                    <div class="home-buttom-announcement col-sm-12"  style="line-height: 32px;"  th:each="u : ${instancy.rows}">
                                                                        <div style="margin-left: -9px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" class="col-sm-6">
                                                                            <a th:title="${u.ntcTitle}" th:classappend="${u.sortCode == '21' && u.nlogid==0?'urgent':(u.sortCode == '12' && u.nlogid==0?'major':(u.sortCode == '11' && u.nlogid==0?'common':'read'))}" onclick="QxWinShowNtc(event,this.id)" th:id="${u.afficheId}">[[${u.ntcTitle}]]</a>
                                                                        </div>
                                                                        <div class="col-sm-3 col-sm-offset-1" style="color: #B0B3B6">发布者：[[${u.issueUser}]]</div>
                                                                        <div class="col-sm-3" style="color: #B0B3B6;text-align: right">[[${#dates.format(u.issueTime,'yyyy-MM-dd HH:mm:ss')}]]</div>
                                                                    </div>
                                                                    <div  th:if="${#lists.size(instancy.rows) eq 0 && total != num} " class="col-sm-12 home-hint">
                                                                        <div>
                                                                            - 暂无新的通知 -
                                                                        </div>
                                                                    </div>
                                                                    <input type="hidden" id="total" th:value="${total}">
                                                                    <div class="col-sm-12" th:unless="${#lists.size(instancy.rows) eq 0}" onclick="loadMore(20,this.id,'instancy',this)" th:id="${num}"  style="text-align: center"><a id="loadMore1" th:text="${instancy.total < 20 ?'到底了':'加载更多'}"></a></div>
                                                                </div>
                                                                <div  th:if="${instancy==null}" class="col-sm-12 home-hint">
                                                                    <div>
                                                                        - 暂无新的通知 -
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div id="b" class="tab-pane">
                                                <div class="panel-body">
                                                    <div class="ibox">
                                                        <div class="ibox-content">
                                                            <div  class="col-sm-12" style="border-radius: 10px;margin: 10px 0 10px 10px;height: 310px;overflow-y:scroll;background-color: #FFFFFF;padding: 0 0 20px;">
                                                                <div th:fragment="search" id="important" style="height: 100%" th:if="${important!=null}">
                                                                    <div class="home-buttom-announcement col-sm-12"  style="line-height: 32px;"  th:each="u : ${important.rows}">
                                                                        <div style="margin-left: -9px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" class="col-sm-6">
                                                                            <a th:title="${u.ntcTitle}" th:classappend="${u.sortCode == '21' && u.nlogid==0?'urgent':(u.sortCode == '12' && u.nlogid==0?'major':(u.sortCode == '11' && u.nlogid==0?'common':'read'))}" onclick="QxWinShowNtc(event,this.id)" th:id="${u.afficheId}">[[${u.ntcTitle}]]</a>
                                                                        </div>
                                                                        <div class="col-sm-3 col-sm-offset-1" style="color: #B0B3B6">发布者：[[${u.issueUser}]]</div>
                                                                        <div class="col-sm-3" style="color: #B0B3B6;text-align: right">[[${#dates.format(u.issueTime,'yyyy-MM-dd HH:mm:ss')}]]</div>
                                                                    </div>
                                                                    <div  th:if="${#lists.size(important.rows) eq 0 && total != num} " class="col-sm-12 home-hint">
                                                                        <div>
                                                                            - 暂无新的通知 -
                                                                        </div>
                                                                    </div>
                                                                    <input type="hidden" id="total" th:value="${total}">
                                                                    <div class="col-sm-12" th:unless="${#lists.size(important.rows) eq 0}" onclick="loadMore(20,this.id,'important',this)" th:id="${num}"  style="text-align: center"><a id="loadMore2" th:text="${important.total < 20 ?'到底了':'加载更多'}"></a></div>
                                                                </div>
                                                                <div  th:if="${important==null}" class="col-sm-12 home-hint">
                                                                    <div>
                                                                        - 暂无新的通知 -
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div id="c" class="tab-pane">
                                                <div class="panel-body">
                                                    <div class="ibox">
                                                        <div class="ibox-content">
                                                            <div  class="col-sm-12" style="border-radius: 10px;margin: 10px 0 10px 10px;height: 310px;overflow-y:scroll;background-color: #FFFFFF;padding: 0 0 20px;">
                                                                <div th:fragment="search" id="common" style="height: 100%" th:if="${common!=null}">
                                                                    <div class="home-buttom-announcement col-sm-12"  style="line-height: 32px;"  th:each="u : ${common.rows}">
                                                                        <div style="margin-left: -9px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" class="col-sm-6">
                                                                            <a th:title="${u.ntcTitle}" th:classappend="${u.sortCode == '21' && u.nlogid==0?'urgent':(u.sortCode == '12' && u.nlogid==0?'major':(u.sortCode == '11' && u.nlogid==0?'common':'read'))}" onclick="QxWinShowNtc(event,this.id)" th:id="${u.afficheId}">[[${u.ntcTitle}]]</a>
                                                                        </div>
                                                                        <div class="col-sm-3 col-sm-offset-1" style="color: #B0B3B6">发布者：[[${u.issueUser}]]</div>
                                                                        <div class="col-sm-3" style="color: #B0B3B6;text-align: right">[[${#dates.format(u.issueTime,'yyyy-MM-dd HH:mm:ss')}]]</div>
                                                                    </div>
                                                                    <div  th:if="${#lists.size(common.rows) eq 0 && total != num} " class="col-sm-12 home-hint">
                                                                        <div>
                                                                            - 暂无新的通知 -
                                                                        </div>
                                                                    </div>
                                                                    <input type="hidden" id="total" th:value="${total}">
                                                                    <div class="col-sm-12" th:unless="${#lists.size(common.rows) eq 0}" onclick="loadMore(20,this.id,'common',this)" th:id="${num}"  style="text-align: center"><a id="loadMore3" th:text="${common.total < 20 ?'到底了':'加载更多'}"></a></div>
                                                                </div>
                                                                <div  th:if="${common==null}" class="col-sm-12 home-hint">
                                                                    <div>
                                                                        - 暂无新的通知 -
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--已读-->
                        <div id="markRead" class="tab-pane">
                            <div class="panel-body">
                                <div class="ibox" style="margin-bottom: 0">
                                    <div class="ibox-content">
                                        <div  class="col-sm-12" style="border-radius: 10px;margin: 10px 0 10px 10px;height: 400px;overflow-y:scroll;background-color: #FFFFFF;padding: 0 0 20px;">
                                            <div th:fragment="search" id="read" style="height: 100%" th:if="${read!=null}">
                                                <div class="home-buttom-announcement col-sm-12"  style="line-height: 32px;"  th:each="u : ${read.rows}">
                                                    <div style="margin-left: -9px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap" class="col-sm-6">
                                                        <a th:title="${u.ntcTitle}" th:classappend="${u.sortCode == '21' && u.nlogid==0?'urgent':(u.sortCode == '12' && u.nlogid==0?'major':(u.sortCode == '11' && u.nlogid==0?'common':'read'))}" onclick="QxWinShowNtc(event,this.id)" th:id="${u.afficheId}">[[${u.ntcTitle}]]</a>
                                                    </div>
                                                    <div class="col-sm-3 col-sm-offset-1" style="color: #B0B3B6">发布者：[[${u.issueUser}]]</div>
                                                    <div class="col-sm-3" style="color: #B0B3B6;text-align: right">[[${#dates.format(u.issueTime,'yyyy-MM-dd HH:mm:ss')}]]</div>
                                                </div>
                                                <div  th:if="${#lists.size(read.rows) eq 0 && total != num} " class="col-sm-12 home-hint">
                                                    <div>
                                                        - 暂无新的通知 -
                                                    </div>
                                                </div>
                                                <input type="hidden" id="total" th:value="${total}">
                                                <div class="col-sm-12" th:unless="${#lists.size(read.rows) eq 0}" onclick="loadMore(20,this.id,'read',this)" th:id="${num}"  style="text-align: center"><a id="loadMore4" th:text="${read.total < 20 ?'到底了':'加载更多'}"></a></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script th:src="@{/ajax/libs/layui/laydate.js}"></script>

</div>
<th:block th:include="include :: footer" />

</body>
<script>
    //当前页条数
    var pageSize=20;
    lay('#version').html('-v'+ laydate.v);

    //执行一个laydate实例
    laydate.render({
        elem: '#test1', //指定元素
        position: 'static',
        showBottom: false
    });

    function QxWinShowNtc(e,val) {
        $(e.target).css('color','gray');
        // alert(val)
        $.post("/notice/log",{afficheId:val},function(result){
           console.log(result)
        });
        var url = '/system/user/saf?id='+val;
        var options = {
            title: "通知详情",
            width: '1280px',
            height: '650px',
            left:'80px',
            url: url,
            skin: 'layui-layer-gray',
            btn: ['关闭'],
            yes: function (index, layero) {
                $.modal.close(index);
            }
        };
        $.modal.openOptions(options);
        // $.operate.detail(val,'850px','650px');
    }

    //通知公告查询
    function safSearch(size,curPage){
        $.modal.loading("数据加载中，请稍后...");
        //搜索内容
        var searchTitle = $('#ntcTitle').val();
        $.ajax({
            url: "/system/notice/search",
            data: {
                content:searchTitle,
                pageNum: curPage,
                pageSize: size
            },
            type: 'POST',
            success: function (data) {
                $.modal.closeLoading();
                // $("#search").html(data)
                var scrollHeight = $('#notice').prop("scrollHeight");
                $('#notice').scrollTop(scrollHeight,200);
            }
        })
    }

    //加载更多
    function loadMore(size,curPage,state,obj){
        var total = parseInt($("#total").val());
        var pageNum = parseInt(curPage);
        var renewal = $(obj).children('a').attr('id');
        var value = $(obj).children('a').text();
        if(pageNum == total && value == "到底了"){
            return;
        }
        $.modal.loading("数据加载中，请稍后...");
        $.ajax({
            url: "/system/notice/loadMore",
            data: {
                content: state,
                pageNum: pageNum+1,
                pageSize: size
            },
            type: 'POST',
            success: function (data) {
                document.getElementById(renewal).remove();
                $.modal.closeLoading();
                $("#"+state).append(data)
                var scrollHeight = $('#notice').prop("scrollHeight");
                $('#notice').scrollTop(scrollHeight,200);
            }
        })
    }

    //通知公告查询
    function more(size,curPage){
        var total = parseInt($("#total").val());
        var pageNum = parseInt(curPage);
        if(pageNum==total){
            return;
        }
        $.modal.loading("数据加载中，请稍后...");
        //搜索内容
        let sortName = $('#urgent').html().trim();
        console.log(sortName);
        var searchTitle = $('#ntcTitle').val();
        // var searchTitle = null;
        $.ajax({
            url: "/system/notice/search",
            data: {
                content:searchTitle,
                pageNum: pageNum+1,
                pageSize: size
            },
            type: 'POST',
            success: function (data) {
                document.getElementById('more').remove();
                $.modal.closeLoading();
                $("#search").append(data)
                var scrollHeight = $('#notice').prop("scrollHeight");
                $('#notice').scrollTop(scrollHeight,200);
            }
        })
    }

    //回车快捷键
    window.onkeyup=function (){
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if(e && e.keyCode==13){ // 按 Enter
            safSearch(10,1);
        }
    }

    function OpenMenuInParent(muID) {
        var toFg = parseInt(muID);
        var ttl="";
        var url="";
        var mTelWF = "/system/mTelWF";
        var mMailWF = "/system/mMailWF";
        if("2601,3603,3616,4721,3640,3656,3663,3669".indexOf(muID) > -1) return;
        switch(toFg){
            case 2101:
                ttl="来电记录草稿";
                url="/system/mTelRcd/listDraft";
                break;
            case 2123:
                ttl="值班长退回";
                url="/system/mTelRcd/listMtrBack";
                break;
            case 2141:
                ttl="待处理来电记录";
                url="/system/mTelRcd/listWait";
                break;
            case 4731:
                ttl="未回访电话工单";
                url="/system/tVstRec/tel/backWaitList";
                break;
            case 3102:
                ttl="电话工单初稿";
                url="/system/workForm/twfDraftList";
                break;
            case 3121:
                ttl="待再次整理T";
                url= mTelWF + "/rManage/secondList.do?muId=3121&act=7&lCol=105&wc=-6&urlStt=120&x=31";
                break;
            case 3123:
                ttl="被退回电话工单";
                url="/cmnTab/twfBackJ";
                break;
            case 3136:
                ttl="待审-办理结果T";
                url= mTelWF + "/rManage/replyWait";
                break;
            case 3137:
                ttl="已审-办理结果T";
                url= mTelWF + "/rManage/replyChked";
                break;
            case 2311:
                ttl="待受理来信";
                url="system/wsMail/wait";
                break;
            case 3303:
                ttl="被退回信件工单";
                // url="../cmnTab/mwfBackJ.jsp?muId=3303&act=7&lCol=121&wc=-12&urlStt=201,251,401&x=33";
                url= mMailWF + "/cmnFile/mmReturnFlow";
                break;
            case 3316:
                ttl="待审-办理结果M";
                url="../mMailWF/rManage/replyWait.do?muId=3316&act=7&lCol=161&wc=-16&urlStt=810,820&x=33";
                break;
            case 4711:
                ttl="未回访信件工单";
                url="../tVstRec/mail/backWaitList.do?muId=4711&act=7&lCol=910&wc=-91&urlStt=900&x=47";
                break;

            // case 2601:
            //     ttl="待受理短信";
            //     url="../mMsgDeal/listWaitGet.do?muId=2601&urlStt=171,181&act=7&wc=-1&lCol=101&x=26";
            //     break;
            // case 3603:
            //     ttl="被退回短信工单";
            //     url="../cmnTab/pwfBackJ.jsp?muId=3603&act=7&lCol=121&wc=-12&urlStt=201,251,401&x=36";
            //     break;
            // case 3616:
            //     ttl="待审-办理结果P";
            //     url="../mMsgWF/rManage/replyWait.do?muId=3616&act=7&lCol=161&wc=-16&urlStt=810,820&x=36";
            //     break;
            // case 4721:
            //     ttl="未回访短信工单";
            //     url="../tVstRec/pmsg/backWaitList.do?muId=4721&act=7&lCol=910&wc=-91&urlStt=900&x=47";
            //     break;


            case 3140:
                ttl="市级未签收T";
                url= mTelWF + "/cmnFile/muSignNot";
                break;
            case 3156:
                ttl="待本部门回复T";
                url= mTelWF + "/cmnFile/muReplyWait";
                break;
            case 3163:
                ttl="未签收t（区县）";
                url= mTelWF + "/cmnFile/muSignNot";
                break;
            case 3169:
                ttl="待本级回复t";
                url= mTelWF + "/cmnFile/muReplyWait";
                break;

            case 3340:
                ttl="市级未签收M";
                url= mMailWF + "/cmnFile/signNotList";
                break;
            case 3356:
                ttl="待本部门回复M";
                url= mMailWF + "/cmnFile/replyWait";
                break;
            case 3363:
                ttl="未签收m（区县）";
                url= mMailWF + "/cmnFile/signNotList";
                break;
            case 3369:
                ttl="待本级回复m";
                url= mMailWF + "/cmnFile/replyWait";
                break;

            case 3157:
                ttl="上级不同意退回工单T";
                url=mTelWF+"/cmnFile/NotPass";
                break;
            case 3357:
                ttl="上级不同意退回工单M";
                url=mMailWF+"/cmnFile/rNotPassList";
                break;

            // case 3640:
            //     ttl="市级未签收P";
            //     url="../mMsgWF/cmnFile/muSignNot";
            //     break;
            // case 3656:
            //     ttl="待本部门回复P";
            //     url="../mMsgWF/cmnFile/muReplyWait";
            //     break;
            // case 3663:
            //     ttl="未签收p（区县）";
            //     url="../mMsgWF/cmnFile/muSignNot";
            //     break;
            // case 3669:
            //     ttl="待本级回复p";
            //     url="../mMsgWF/cmnFile/muReplyWait";
            //     break;
            case 3158:
                ttl="未受理电话工单";
                url=mTelWF+"/cmnFile/notHandleTelList";
                break;
            case 3358:
                ttl="未受理信件工单";
                url=mMailWF+"/cmnFile/notHandleMailList";
                break;
            default:
                break;
        }
        $.modal.openTab(ttl,url);
    }

    function menuItem() {
        // 获取标识数据
        var dataUrl = $(this).attr('href'),
            dataIndex = $(this).data('index'),
            menuName = $.trim($(this).text()),
            isRefresh = $(this).data("refresh"),
            flag = true;
        if(dataUrl == '#') return;

        var $dataObj = $('a[href$="' + decodeURI(dataUrl) + '"]');
        if (!$dataObj.hasClass("noactive")) {
            $('.tab-pane li').removeClass("active");
            $('.nav ul').removeClass("in");
            $dataObj.parents("ul").addClass("in")
            $dataObj.parents("li").addClass("active").siblings().removeClass("active").find('li').removeClass("active");
            $dataObj.parents("ul").css('height', 'auto').height();
            $(".nav ul li, .nav li").removeClass("selected");
            $(this).parent("li").addClass("selected");
        }
        setIframeUrl(dataUrl);
        if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;

        // 选项卡菜单已存在
        $('.menuTab').each(function() {
            if ($(this).data('id') == dataUrl) {
                if (!$(this).hasClass('active')) {
                    $(this).addClass('active').siblings('.menuTab').removeClass('active');
                    scrollToTab(this);
                    // 显示tab对应的内容区
                    $('.mainContent .NAP_iframe').each(function() {
                        if ($(this).data('id') == dataUrl) {
                            $(this).show().siblings('.NAP_iframe').hide();
                            return false;
                        }
                    });
                }
                if (isRefresh) {
                    refreshTab();
                }
                flag = false;
                return false;
            }
        });
        // 选项卡菜单不存在
        if (flag) {
            var str = '<a href="javascript:;" class="active menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i></a>';
            $('.menuTab').removeClass('active');

            // 添加选项卡对应的iframe
            var str1 = '<iframe class="NAP_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
            $('.mainContent').find('iframe.NAP_iframe').hide().parents('.mainContent').append(str1);

            $.modal.loading("数据加载中，请稍后...");

            $('.mainContent iframe:visible').load(function () {
                $.modal.closeLoading();
            });

            // 添加选项卡
            $('.menuTabs .page-tabs-content').append(str);
            scrollToTab($('.menuTab.active'));
        }
        return false;
    }
    function openUrl(val,url){
        $.modal.openTab(val,url)
    }

    $('.menuItem').on('click', menuItem);

    function hiddenSub(){
        document.getElementById("isHidden").hidden=true;
    }

    // 催办详情页面
    function openUrgeDetail(type) {
        var ttl = '';
        var url = '';
        var mTelWF = "/system/mTelWF";
        var mMailWF = "/system/mMailWF";
        if(type === 'tel'){
            ttl="电话催办工单";
            url= mTelWF + "/cmnFile/supUrgeTelOrder";
        }else if(type === 'mail'){
            ttl="信件催办工单";
            url= mMailWF + "/cmnFile/supUrgeMailOrder";
        }
        $.modal.openTab(ttl,url);
    }
</script>
</html>
